<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>主页</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <!--weui.min.css-->
    <link rel="stylesheet" href="/static/index/css/page/base.css"/>
    <link rel="stylesheet" href="/static/index/css/page/font.css"/>
    <link rel="stylesheet" href="/static/index/jquery_weui/css/swiper.min.css"/>
    <link rel="stylesheet" type="text/css" href="/static/index/jquery_weui/lib/weui.min.css">
    <!--jquery-weui.min.css-->
    <link rel="stylesheet" type="text/css" href="/static/index/jquery_weui/css/jquery-weui.min.css">
    <link rel="stylesheet" href="/static/index/css/page/index.css" />
</head>
<style>
	/*图片处理css*/
	.list2 .swiper-slide>a{
		overflow: hidden;
		position: relative;
	}
	.list2 .swiper-slide>a img{
		
		position: absolute;
		left: 50%;
		top: 50%;
	}
	
	.noteMemo .weui-cell__bd>a{
    		margin: .2rem 0;
    	
    	}
    	.noteMemo .weui-cell__bd{
    		padding: .2rem 0;
    		height: 1.5rem;
    		overflow: hidden;
    	}
    	
    	.weui-popup__overlay{
    		background: #7e7e7e;
    		opacity: .5;
    	}
    	.weui-popup__modal{
    		bottom: auto;
    		width: 70%;
    		background: #fff;
    		top: 40%;
    		left: 9%;
    		padding: 6%;
    		border-radius: 7px;
    	}
    	.noteMemo-btn>a{
    		margin: .3rem;
    	}
    	.weui-popup__container {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            width: 100%;
            height: 100%;
            z-index: 10000000000;
        }
</style>
<body>

<div class="pageControl index">


    <div class="zhe1"></div>

    <div class="bg-di"></div>
    <div class="msui_nav msui_navTop">
        <a class="msui_navTop-back" href="javascript:history.back();"><i class="micon-back"></i></a>
        <h1 class="msui_navTop-title">附近活动</h1>
        <!--<a class="msui_navTop-icon" href="">
            <i class="micon-message"></i>
        </a>-->
    </div>
    <div class="index-top">
        <div class="index-top-tab">
            <div class="index-tab">
            </div>
        </div>
    </div>
    <div>
        
        <div data-value="2" class="tab active1 personal-list">
        	{foreach name="info" item="vo"}
            <div class="list t0">
                <div class="weui-cell list1">
                    <div class="weui-label">
                        {if $vo.img}
                            <a href="javascript:;" class="other_href"><img src="{$vo.img}" alt=""/></a>
                        {else}
                            <a href="javascript:;" class="other_href"> <img src="/static/index/images/head.png" alt=""/></a>
                        {/if}
                        <input type="hidden" value="{$vo.uid}">
                    </div>
                    <div class="weui-cell__bd">
                        <div>{$vo.name}</div>
                        <div class="list-age">
                            <p class="">
                                {if $vo.sex eq 1}<img src="/static/index/images/n1.png" alt=""/>{else}<img src="/static/index/images/n0.png" alt=""/>{/if}
                                <span  class="cl-47c">{$vo.age}岁</span>
                            </p>
                            <p class="">
                                {if $vo.is_rz eq 1}<img src="/static/index/images/x0.png" alt=""/>{/if}
                                <span  class="cl-fc8">{if $vo.is_rz eq 0}未认证{elseif $vo.is_rz eq 2}待审核{else}已认证{/if}</span>
                            </p>
                        </div>
                    </div>
                    <div class="weui-cell__ft">
                        <p>{$vo.create_time}</p>
                    </div>
                </div>
                <div class="list2">
                    <p class="list2-a"><span class="cl-26c">{$vo.go_time}</span>{$vo.content}</p>
                    <div class="swiper-container">
                        <div class="swiper-wrapper">
                        	<?php $ssh = explode("|",$vo['photo']);?>
        					{foreach name="ssh" item="hot_photo"}
	                            <div class="swiper-slide">
	                                <a href="/index/index/detail?id={$vo.id}&uid={$vo.uid}"><img src="{$hot_photo}" alt=""/></a>
	                            </div>
                            {/foreach}
                        </div>
                        <div class="pic-count"><?php echo count($ssh)?>张</div>
                    </div>
                    <div class="weui-cell1">
                        <div class="weui-cell__bd">
                            <img src="/static/index/img/x1.png" alt=""/>
                            <span class="cl-9999">我在{$vo.address}</span>
                        </div>
                        <div class="weui-cell__ft">
                            <img src="/static/index/img/x2.png" alt=""/>
                            <span>{$vo.count}</span>
                        </div>
                        <div class="weui-cell__ft">
                            <img src="/static/index/img/x3.png" alt=""/>
                            <span>{$vo.comment_count}</span>
                        </div>
                    </div>
                    <div class="weui-cell1 noteMemo">
	                        <div class="weui-cell__bd index-btn1">
	                            <img src="/static/index/img/x4.png" alt=""/>
                              {foreach name="vo.tag_id" item="tags"}
                              <a href="javascript:;" class="bg-27c cl-f note-list">{$tags['tag']}</a>
                              {/foreach}
                            <a class="moretag bg-27c cl-f groupb  note-more" href="javascript:;" data-target='#noteMemo3'>更多<input type="hidden" class="agroup" value="{$vo['id']}"/>
                                <input type="hidden" class="cate" value="{$vo.cate_id}"/>
                            </a>
	                        </div>
	                </div>
                </div>
            </div>
            {/foreach}
        </div>
        
    </div>
</div>

<!--更多标签-->
<div id="noteMemo3" class="weui-popup__container popup-bottom">
  <div class="weui-popup__overlay"></div>
  <div class="weui-popup__modal index-btn1 noteMemo-btn" id="shows">

  </div>
</div>

<!-- jquery-2.1.4 -->
<script type="text/javascript" src="/static/index/jquery_weui/lib/jquery-2.1.4.js"></script>
<!-- jquery-weui.min.js -->
<script type="text/javascript" src="/static/index/jquery_weui/js/jquery-weui.min.js"></script>
<script src="/static/index/jquery_weui/js/swiper.min.js"></script>
<!--cookie-->
<script src="/static/index/jquery_weui/js/jquery.cookie.js"></script>
<!--获取当前位置经纬度-->
<script src="http://api.map.baidu.com/api?v=1.2" type="text/javascript"></script>
<script>

    $('.other_href').on('click',function(){
        var uid = $(this).next().val();
        $.cookie('uid',uid);
        if(uid)window.location.href="/index/other/other";
    });

	$(".moretag").click(function (){
        var id= $(this).children('.agroup').val();
        var cate= $(this).children('.cate').val();
        $.ajax({
            type:'post',
            url:'/index/index/onetag',
            data:{id:id,cate:cate},
            success:function(data){
                //alert(date);
                var arr = JSON.parse(data);

                var str = "";
                for(var i=3;i<arr.length;i++){
                	if(arr[i]['id'] >99){
                		str+="<a href='javascript:;' class='bg-27c cl-f note-list'>"+arr[i]['tag']+"</a>";
                	}else{
                		str+="<a href='javascript:;' class='bg-27c cl-f note-list'>"+arr[i]['tag']+"</a>";
                	}
                    
                }
                $("#shows").html("");
                $("#shows").append(str);
                $("#noteMemo3").popup();
            }
        });
    });


	

		$(function(){
//		图片处理
		$('.personal-list .swiper-slide>a img').each(function(){
			
			var imgWidth=-parseFloat($(this).css('width'))/2;
			var imgHeight=-parseFloat($(this).css('height'))/2;
			
			var imgWidth1=parseFloat($(this).css('width'));
			var imgHeight1=parseFloat($(this).css('height'));
			if(imgWidth1>=imgHeight1){
				$(this).css({
					height:'100%',
					width:'auto'
				})
			$(this).css('top','0')
			$(this).css('margin-left',imgWidth)
			}else if(imgWidth1<imgHeight1){
				$(this).css({
					height:'auto',
					width:'100%'
				})
				$(this).css('margin-top',imgHeight)
				$(this).css('margin-left',imgWidth)
			}
		})
		
		
		/*更多标签*/
		$('.noteMemo').each(function(){
		var ttCount=$(this).find('.index-btn1 a.note-list').length;
		var listCount=$(this).find('.index-btn1 a').length;
		if(listCount>4){
			for(var i=1;i<=ttCount;i++){
				if(i>3){
					$(this).find(`.index-btn1 a.note-list:nth-of-type(${i})`).css('display','none')
				}
			}
			$(this).find('.note-more').css('display','inline-block')
		}else if(listCount<=4){
			$(this).find('.note-more').css('display','none')
		}
//  console.log(listCount)
		})
		
		var swiperWidth=$('.list .swiper-slide').width();
		$('.list .swiper-slide').css('height',swiperWidth)
		$('.list .swiper-slide>a img').css('min-height',swiperWidth)
		
		$('.noteMemo').each(function(){
			var ttCount=$(this).find('.index-btn1 a.note-list').length;
			var listCount=$(this).find('.index-btn1 a').length;
			if(listCount>4){
				for(var i=1;i<=ttCount;i++){
					if(i>3){
						$(this).find(`.index-btn1 a.note-list:nth-of-type(${i})`).css('display','none')
					}
				}
				$(this).find('.note-more').css('display','inline-block')
			}else if(listCount<=4){
				$(this).find('.note-more').css('display','none')
			}
		})
	})



    $("#datetime-picker").datetimePicker();
    $(".time").change(function(){
        var time = $("#datetime-picker").val();
        document.cookie="time="+time;
    });
    
    $(".goBack").click(function (e) {
        e.preventDefault();
        $(".indexMessage").hide(400)

    })
    
    var swiper = new Swiper('.swiper-container', {
        slidesPerView: 3,
        spaceBetween: 5
    });
    /*for(var j=1;j<4;j++){
        var listLength=$(`[data-value='${j}'] .list`).length;
        for(var t=0;t<listLength;t++){
            var slider_length=$(`[data-value='${j}'] .t${t} .swiper-wrapper`).children().length;
            $(`[data-value='${j}'] .t${t} .pic-count`).html(slider_length+"张")
        }
    }*/
    $(".index-tab").on('click','a',function(e){
        e.preventDefault();
        var count=$(this).attr('href');
        $(this).addClass('active')
                .siblings().removeClass('active');
        $(`[data-value='${count}']`).addClass("active1")
                                    .siblings().removeClass('active1');
        var swiper = new Swiper('.swiper-container', {
            slidesPerView: 3,
            spaceBetween: 5
        });
    })
</script>
</body>
</html>

